package leecode

func finalValueAfterOperations(operations []string) (result int) {
	hashMap := make(map[string]int)
	hashMap["X++"] = 1
	hashMap["++X"] = 1
	hashMap["X--"] = -1
	hashMap["--X"] = -1
	for i := 0; i < len(operations); i++ {
		result += hashMap[operations[i]]
	}
	return
}
